implementing the allowHalfOpen option and destroy method
support allowHalfOpen=false and add tests
fix #4, fix #6