Bug 859662 - Cursor based getThreads(). r=julienw, a=leo+ (cherry-picked from commit a77354cfa6cdae674f029def7ad7044492fb68a2)