Safe daemonization from within Java