Allow customizing the StateData in p1_fsm before error reporting.
A new callback is introduced on the p1_fsm behaviour:
print_error/1
If the module implements this function, it will be invoked
in case of process crash with the current state data *before*
printing the error in the log. The function must return the
desired State to print.
It is used in ejabberd_c2s to prune the presence sets that
can be large. Instead, the state is changed to include only
the # of elements on each set.
Change inspired in comming changes to gen_server on OTP, and
http://github.com/erlyvideo/erlyvideo/commit/
b01d15abc3189226dbf824db19db22da35fa33a0#diff-0