Proper Loss Functions for Nonlinear Hawkes Processes