Remove duplicate code in fdb_iterator_prev() and fdb_iterator_next()
Remove duplicate code in fdb_iterator_prev() and fdb_iterator_next()

+ Introducing a new function _fdb_iterate() with an option to
iterate backward in case of fdb_iterator_prev() or iterate forward
in case of fdb_iterator_next().

Change-Id: I53a1389141d696b3859aac5808ab459639d84b88
Reviewed-on: http://review.couchbase.org/63588
Reviewed-by: Chiyoung Seo <fcffc23db27b19ee4ebba46695ee6b50e09216a2@couchbase.com>
Tested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>

couchbase/forestdb,couchbase/forestdb,wurikiji/forestdb,hisundar/forestdb,wurikiji/forestdb,hisundar/forestdb