factor out read_cache_cancel_foreground()

Signed-off-by: Akira Hayakawa <ruby.wktk@gmail.com>
Implement background cancellation

Signed-off-by: Akira Hayakawa <ruby.wktk@gmail.com>
replace the data structure with rbtree

Signed-off-by: Akira Hayakawa <ruby.wktk@gmail.com>