[utils] provide a better applet_log function

- don't double check log_level

- check if message is null point before dereference it

- use macro BUFSIZE to replace hardcode 1024