Add permission check to datadir

This patch fixes https://github.com/jubatus/jubatus/issues/599.