Fix performance of listing writeable folders (#1489451)