nanosleep - don't write to rmtp if it's NULL

rmtp can be NULL, so don't try to write to it if it is.