Fix incorrect command line argument check to prevent segv if passing
too few arguments to local laplacian process command.
Change ref count logic in halide_release to take into account
that the command queue holds a reference to the context.

Add extra debug output to copy_to_host to print buf ptr.
Switch apps Makefiles to including common code to make it easier to edit.