Add async support.
Add async test and fix file descriptor issue.