Bulk locality from modular flow