One of the problems with the EPCS driver in a multitasking environment is that it isn't thread safe. The EPCS needs a series of instructions and will return a series of bytes for each request, and the transaction mustn't be interrupted by another one. If you have two threads that try to access the EPCS at the same time, both will get garbage data as a result. You should check if by any chance you could have another task that could try to access the EPCS or the file system just when you are answering to a http request (or have several parallel tasks that handle http requests, but it doesn't seem to be the case in this code). If yes then you need either to allow only one task to access the EPCS, or add a synchronization system in the driver (mutexes) to prevent this from happening.
The CFI flash doesn't have this problem because it answers immediately to a read or write request, those operations are atomic by design.